<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8" />
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<title>骨医快线</title>
	<link rel="stylesheet" href="../../css/mui.plus.css" />
</head>
<body>
	<header class="mui-bar mui-bar-nav pri-bar">
	    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
	    <h1 class="mui-title">康复宝</h1>
	</header>
	
	<div class="mui-content">
		<ul id="list-article" class="mui-table-view"></ul>
		
		<script id="tmp-article" type="text/html">
			{{each data as v i}}
			<li class="mui-table-view-cell">
	            <a style="width: 90%;display: inline-block" 
	               data-page = "article-detail.html" 
				   data-url = '{{v.edu_wx_url}}'>
	                {{v.edu_title}}
	            </a>
	            <span class="mui-icon mui-pull-right"
	            	  data-page="qrcode.html"
	            	  data-url = '{{v.edu_wx_url}}'>
	            	<img src="../../images/icon-qrcode-blank.png" style="width: 20px;" id="btn-qrcode"/>
	            </span>
	        </li>
	        {{/each}}
		</script>
	</div>
	
	<script src="../../js/mui.min.js"></script>
	<script src="../../js/app.js"></script>
	<script src="../../js/lib/template.js"></script>
	<script>
		;(function($, a){
			
			$('#list-article').on('tap', 'a', function(){
				$.openWindow({
					url: this.dataset.page,
					waiting: {
						autoShow: false
					},
					extras: {
						url: this.dataset.url
					}
				});
			});
			
			$('#list-article').on('tap', 'span', function(){
				$.openWindow({
					url: this.dataset.page,
					waiting: {
						autoShow: false
					},
					extras: {
						url: this.dataset.url,
						desc: '扫描二维码在微信中查看'
					}
				});
			});
			
			$.plusReady(function(){
				a.net.post('c_kfb_edu_article/show_list', {}, function(data){
					if(data && data.code === '100'){
        				tmpData = data;
        				html = template('tmp-article', tmpData);
    					document.getElementById("list-article").innerHTML = html;
    				}
				})
			});
			
		}(mui, app));
	</script>
</body>
</html>